package com.xdf.teacher.entity;

import com.alibaba.fastjson.JSON;

import org.haitao.common.utils.AppLog;

import java.io.Serializable;

public class UserBean implements Serializable {

    private String user_id;
    private String login_id;
    private String course_id;
    private int room_mute; //value为"1"静音，"0"取消静音
    private int rec_all;
    private int aid;
    private int vid;
    private String session_id;
    private String user_nickname;
    private int role; //1老师 2学生 3助教
    /**
     * privilege : {"person_mute":0}
     */

    private PrivilegeBean privilege;

    public UserBean(String json) {
        AppLog.e("=========master==========");
        UserBean userBean = JSON.parseObject(json, getClass());
        setUser_id(userBean.getUser_id());
        setLogin_id(userBean.getLogin_id());
        setCourse_id(userBean.getCourse_id());
        setRoom_mute(userBean.getRoom_mute());
        setRec_all(userBean.getRec_all());
        setAid(userBean.getAid());
        setVid(userBean.getVid());
        setSession_id(userBean.getSession_id());
        setUser_nickname(userBean.getUser_nickname());
        setRole(userBean.getRole());
    }

    public UserBean() {
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getLogin_id() {
        return login_id;
    }

    public void setLogin_id(String login_id) {
        this.login_id = login_id;
    }

    public String getCourse_id() {
        return course_id;
    }

    public void setCourse_id(String course_id) {
        this.course_id = course_id;
    }

    public int getRoom_mute() {
        return room_mute;
    }

    public void setRoom_mute(int room_mute) {
        this.room_mute = room_mute;
    }

    public int getRec_all() {
        return rec_all;
    }

    public void setRec_all(int rec_all) {
        this.rec_all = rec_all;
    }

    public int getAid() {
        return aid;
    }

    public void setAid(int aid) {
        this.aid = aid;
    }

    public int getVid() {
        return vid;
    }

    public void setVid(int vid) {
        this.vid = vid;
    }

    public String getSession_id() {
        return session_id;
    }

    public void setSession_id(String session_id) {
        this.session_id = session_id;
    }

    public String getUser_nickname() {
        return user_nickname;
    }

    public void setUser_nickname(String user_nickname) {
        this.user_nickname = user_nickname;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public PrivilegeBean getPrivilege() {
        return privilege;
    }

    public void setPrivilege(PrivilegeBean privilege) {
        this.privilege = privilege;
    }

    public static class PrivilegeBean {
        /**
         * person_mute : 0
         */

        private int person_mute;
        private int person_video;

        public int getPerson_mute() {
            return person_mute;
        }

        public void setPerson_mute(int person_mute) {
            this.person_mute = person_mute;
        }

        public int getPerson_video() {
            return person_video;
        }

        public void setPerson_video(int person_video) {
            this.person_video = person_video;
        }

        @Override
        public String toString() {
            return "PrivilegeBean{" +
                    "person_mute=" + person_mute +
                    ", person_video=" + person_video +
                    '}';
        }
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "user_id='" + user_id + '\'' +
                ", login_id='" + login_id + '\'' +
                ", course_id='" + course_id + '\'' +
                ", room_mute=" + room_mute +
                ", rec_all=" + rec_all +
                ", aid=" + aid +
                ", vid=" + vid +
                ", session_id='" + session_id + '\'' +
                ", user_nickname='" + user_nickname + '\'' +
                ", role=" + role +
                ", privilege=" + privilege +
                '}';
    }
}
